
package guoan.domain;

import guoan.core.jodaJson.DateTimeYYYYMMDDHHMMSSSerializer;
import guoan.core.jodaJson.DateTimeYYYYMMDDSerializer;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

import org.hibernate.annotations.Type;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 教练陪练
 * 
 */
@Entity
public class Coach implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * ID 自动增长
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeYYYYMMDDHHMMSSSerializer.class)
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
    @Column(name = "create_time")
    private DateTime createTime;

    /**
     * 考试时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = DateTimeYYYYMMDDSerializer.class)
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
    @Column(name = "coach_time")
    private DateTime coachTime;

    /**
     * 开放时间 8:30 9:00..,
     */
    @Column(name = "open_hours")
    private String openHours;

    /**
     * 类型,科目二、科目三 ,
     */
    @Column(name = "type")
    private Long type;

    @Column(name = "jg")
    private String jg;
    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeYYYYMMDDHHMMSSSerializer.class)
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
    @Column(name = "update_time")
    private DateTime updateTime;

    @Column(name = "train_id")
    private Long trainId;

    @Column(name = "three_coach_config")
    private String threeCoachConfig;

    /**
     * @Fields status : 预约状态 1：开启，0：取消
     */
    private Long status = 1L;

    /**
     * @Fields ism : 是否预约已经满了
     */
    @Transient
    private Long ism = 0L;
    /**
     * 
     * @Fields isyy : 已有多少预约
     */
    @Transient
    private Long isyy = 0L;

    public Coach(){
    }

    public Long getId(){
        return this.id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public DateTime getCreateTime(){
        return this.createTime;
    }

    public void setCreateTime(DateTime createTime){
        this.createTime = createTime;
    }

    public DateTime getCoachTime(){
        return this.coachTime;
    }

    public void setCoachTime(DateTime examTime){
        this.coachTime = examTime;
    }

    public String getOpenHours(){
        return this.openHours;
    }

    public void setOpenHours(String openHours){
        this.openHours = openHours;
    }

    public DateTime getUpdateTime(){
        return this.updateTime;
    }

    public void setUpdateTime(DateTime updateTime){
        this.updateTime = updateTime;
    }

    public Long getType(){
        return type;
    }

    public void setType(Long type){
        this.type = type;
    }

    public String getJg(){
        return jg;
    }

    public void setJg(String jg){
        this.jg = jg;
    }

    public Long getTrainId(){
        return trainId;
    }

    public void setTrainId(Long trainId){
        this.trainId = trainId;
    }

    public Long getStatus(){
        return status;
    }

    public void setStatus(Long status){
        this.status = status;
    }

    public Long getIsm(){
        return ism;
    }

    public void setIsm(Long ism){
        this.ism = ism;
    }

    public Long getIsyy(){
        return isyy;
    }

    public void setIsyy(Long isyy){
        this.isyy = isyy;
    }

    public String getThreeCoachConfig(){
        return threeCoachConfig;
    }

    public void setThreeCoachConfig(String threeCoachConfig){
        this.threeCoachConfig = threeCoachConfig;
    }

}